<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://qzone.qq.com/251303704/pagination" prefix="p" %>

<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
		<base href="<%=basePath%>"/>
		<meta charset="utf-8" />
		<title>Document</title>
	</head> 
	<style type="text/css">
		table{
			width:100%;
			border-collapse:collapse;
			
		}
		table tr{
			border:1px solid #B5CFD9;
			text-align: center;
		}
		table td{
			border:1px solid #B5CFD9;
			text-align: center;
			
			
		}
		table td img{
			margin:0px;
		}
		.select{
			width:550px;
			margin:0px auto;
		}
		.select p{
			float:left;
		}
		.name{
			border:0px;
			height:22px;
			width:200px;
			border:1px solid #B5CFD9;
		}
		.chaxun{
			background-color:#B87354;
			color:#fff;
			width:50px;
			text-align:center;
			border-radius:5px;
			border:0px;
			height:25px;
			cursor: pointer;
			margin-left:20px;
			margin-top:13px;
		}
		.chaxun:hover{
			background-color:#AA895E;
		}
		.page{
			margin-top:20px;
			float:right;
		}
		.page a{
			color:#000;
			text-decoration: none;
			padding:5px 10px;
			border:1px solid #eee;
			margin:0px 5px;
		}
		.page a:hover{
			color:#B81C22;
		}
		.page a.active{
			font-weight:bold;
			color:#fff;
			background-color:#B87354;
		}
		.page a:hover{
			cursor: default;	
		}
		.page a{
			color:#000;
		}
		.page  a:hover{
			cursor: default;	
		}
	</style>
	
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script type="text/javascript">
		$(function() {
			/* var ss=$(".zhuan").text();
			if(ss="已发货"){
				$(".dai").attr("href","javascript:void(0)");
			} */
			
		})
	</script>
	
	<body>
	<%@ include file="/HT/login_control.jsp" %>
	<!-- <h1 style="text-align:center">所有订单</h1> -->
	<form action="order.shtml" method="post" id="form1">
		<div class="select">
			<p>请输入订单编号：<input type="text" name="orderid" value="${orderid}">&emsp;
			<p>订单状态：
				<select name="type" id="select">
					
					
					<c:forEach items="${liststate }" var="state">
						
						<option value="${state.state_id }">${state.state_state }</option>	
					</c:forEach>
					<option value="-1">全部</option>
				</select>
				<script>
					$("#select").val(${type});
				</script>
			</p>
			<input type="submit" value="查询" class="chaxun"></p>
		</div>
		<div id="hezi">
			<table> 
				<tr>
					<td>订单编号</td>
					<td>用户名称</td>
					<td>用户手机号</td>
					<td>下单日期</td>
					<td>收货地址</td>
					<td>订单状态</td>
					<td>订单详情</td>
					<td>操作</td>
				</tr>
				<c:forEach items="${list }" var="order">
					<tr>
						<td>${order.o_idname }</td>
						<td>${order.o_username}</td>
						<td>${order.o_phone }</td>
						<td>${order.o_Date }</td>
						<td>${order.o_ssxx }</td> 
						<td class="zhuan">
						<c:if test="${order.getState().getState_id()==1}">
							待处理
						</c:if>
						<c:if test="${order.getState().getState_id()==2}">
							待发货
						</c:if>
						<c:if test="${order.getState().getState_id()==3}">
							已发货
						</c:if>
						</td>
						<td><a href="ordermx.shtml?id=${order.o_id }">查看</a></td>
						<td>
						<c:if test="${order.getState().getState_id()==3}">
							<a href="javascript:void(0)" class="dai" date="2">待发货</a><br><a href="javascript:void(0)" date="3">已发货</a>
						</c:if>
						<c:if test="${order.getState().getState_id()==1}">
							<a href="orderupdated1.shtml?id=${order.o_idname }" class="dai" date="2">待发货</a><br><a href="updatestatey.shtml?id=${order.o_idname }" date="3">已发货</a>
						</c:if>
						<c:if test="${order.getState().getState_id()==2}">
							<a href="javascript:void(0)" class="dai" date="2">待发货</a><br><a href="updatestatey.shtml?id=${order.o_idname }" date="3">已发货</a>
						</c:if>
						</td>
				</tr>
				</c:forEach>
			</table>
			
		</div>
		<p:page pageBean="${pageBean }"/>
		</form>
	</body>
</html>
